// uart.h

#ifndef UART_H
#define UART_H

#include <visibility.h>
#include "serialport.h"

class __EXPORT Uart : public SerialPort {
public:
	Uart(const char *name, int baudRate, int timeOut);
	virtual ~Uart();
	virtual bool lock();
	virtual void unlock();
	virtual int read(void *buf, int size);
	virtual void write(const void *buf, int size);
	virtual void clean();

private:
	Uart();
	Uart(const Uart &);
	
	void init();
	void deinit();

	char name_[32];
	const int baudRate_;
	const int timeOut_;
	int port_;	// Port handle, -1 if port is not opened
};

#endif
